if @rec=HEAD
  NewLine
  cell static,local("Default Place Hierarchy")&":"
  set width -1
  Show FORM

else if @rec=SOUR
  use _Unknown_

else if #msg="Event"
  ! edit field with value for table of events, residences, or attributes
  cell editvalue
  set tabwidth 1 width #cellWidth$+2
  #addr=@parent.ADDR
  if #addr!=""
    help local("ADDR")&": "&replace(return&"\, \"&#addr)
  else
    help local("Enter place for this event")
  endif
  hskip -2

  cell static
  set tabwidth 1 alignment center border square height 20
  cellBackground "Editing Background"

  ! link to place record
  if tag exists
    if @contents.p._BOX._BNDS!=""
      #pim="urllink"
      #ihgt=17
    else if @contents.p._URL!=""
      #pim="urllink"
      #ihgt=17
    else
      #pim="GPS"
      #ihgt=19
    endif
    tab -2
    cell LinkButton
    set tabwidth 1 border none
    set image #pim imageheight #ihgt target child
    watch @contents.p.rec
    watch @parent.PLAC
    set autoreload yes
    RecordLink "place"
    help local("Click to view and edit place record")
  endif
  
else
  ! place in birth, death, or marriage box
  #edge=#rightMargin$-#rightSkip-21-#cellSkip
  NewLine
  cell static,local(@tag)&":"
  set tabwidth -1 alignment right

  ! edit field with value
  cell editvalue
  set Width #edge-#hpos$ offset 1
  help local("Enter place for this event")

  ! link to place record
  if tag exists
    if @contents.p._BOX._BNDS!=""
      #pim="urllink"
    else if @contents.p._URL!=""
      #pim="urllink"
    else
      #pim="GPS"
    endif
    cell LinkButton
    set border no width 20
    set image #pim target child autoreload yes
    RecordLink "place"
    help local("Click to view and edit place record")
    watch @parent.PLAC
    watch @contents.p.rec
  endif
  
  #i=1
  #lineSkip=0
  RepeatWith "#place" from @contents.p._PLACE
    if #i>1
      NewLine
      if #i=2
        tab 1
        hskip 8
        cell static,local("Other")&":"
        set fontsize 10
        sizetofit
        ! font size get height=13, add 2 pixels
        set height 15
        hskip 0
        #altspot=#hpos$
      else
        HMoveTo #altspot
      endif
      ! hwight to match ADDR ouput in Event template
      cell expression,@contents.p._PLACE.i.#i
      set width -1 fontsize 10 height 15
    else if #i=1
      ! skips first name, which is the place
      ! but can adjust spacing to the first line here
      NewLine 1
    endif
    #i+=1
  EndRepeat
  ! reduce space in case address there to
  if #i>1
    newline -1
  endif

endif